<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>canvs创建画布</title>
    <style>
        canvas{
            border: 1px solid rgb(19, 18, 18);
        }
    </style>
</head>
<body>
    <canvas id="demo1" width="600px" height="600px"></canvas>
    <script  type="text/javascript">
    //获取元素dom
    let demo1=document.querySelector('#demo1')
    //指定画布是2d形式
    let ctx= demo1.getContext('2d')
    </script>
</body>
</html>